<template>
  <div class="flex-app-continer">
    <el-dialog
      title='选择开票项目及优惠政策标识'
      ref='modal1'
      :visible="dialogVisible"
      width="80%"
      @close="closeSearch"
      :modal-append-to-body="false"
      >
        <projectListCompNew v-if="handlerLife"  @rowClick="rowClick" @submitSearch="submitSearch" v-bind="$attrs"></projectListCompNew>

        <!-- <div style="float: right">
          <vxe-button @click="closeSearch" status="info">取消</vxe-button>
          <vxe-button @click="submitSearch" status="primary">确定</vxe-button>
        </div> -->

    </el-dialog>

  </div>
</template>
<script>
import { mixin,mixinVariable } from '@/utils/mixin.js'
import { getCodePage } from '@/api/vmsClassifyCode.js';
import projectListCompNew from './projectListCompNew.vue'


export default {
  name: 'projectListComp',
  mixins: [mixin,mixinVariable],
  data() {
    return {
      handlerLife:true,
      rowClickRow:null,
      dialogVisible:false,
      infoFormData:null,
      formData: {
        hbcode:'', //商品和服务税收分类合并编码
        productCode:'',//产品编码
        productName: '', //产品名称
        proname: '', //商品和服务名称
        selectSource: '1', //项目选取来源，1商品及服务名称 2产品名称
        shortName:'' //商品和服务简称
      },


      timer:null
    }
  },
  components: {
    projectListCompNew,
  },
  methods: {
    rowClick(val){
      this.rowClickRow = val;
    },

    // 页面展示完成， 点击保存回传数据。
    async submitSearch(){
      console.log(11)
      let k = this;
      if(k.rowClickRow==null){
        this.$message({
              type: 'warning',
              message: '请选择开票项目！',
          })
        return
      }

      
      let pname = '*'+k.rowClickRow.sphfwfljc+'*'+k.rowClickRow.epsName
      // let pname = this.formData.selectSource=='1' ? '*'+k.selectRow.sphfwfljc+'*'+k.selectRow.sphfwmc : '*'+k.selectRow.sphfwmc+'*'+k.selectRow.productName  //改改改改改
      // this.$emit('selected',{row:k.selectRow, pname:pname, selectSource:this.formData.selectSource});
      this.$emit('selected',{row:k.rowClickRow,pname,selectSource:this.formData.selectSource})
      this.closeSearch()
    },
    closeSearch(){
      this.dialogVisible = false

    },
    show(d) {
      this.handlerLife = false;
      this.infoFormData = d
      this.rowClickRow = null;
      this.$nextTick(()=>{
        this.handlerLife = true;
        this.dialogVisible = true;
      })

    }
  },
}
</script>
<style lang="scss" >
.flex-app-continer{
  .vxe-modal--content{
    height: auto;
}
}

.flex-app-continer-table-div{
  width: 98vw;
}
::v-deep .vxe-modal--box{
  width: 100vw;
  height: 100vh;
}
.op-area{position: absolute;left: 0;top:0;}
.expand-wrapper {
  padding: 20px;
}
.form-con{width: 900px; margin:0 auto;}
.vxe-form--item-title{max-width: 500px;}
.radio-area{width: 210px; margin:0 auto;position: relative;left:10px;padding-bottom:5px;}
.radio-tit{margin-right:10px;}
.box-tit{margin-bottom:10px;}
.select-area{padding-bottom:100px;margin-top:10px;}
.non-select{color: #F90707;margin-left:20px;}
.select{color: #333;margin-left:20px;}

:v-deep .vxe-table--render-default .vxe-cell--radio .vxe-radio--icon{
  font-size: 16px !important;
}
:v-deep .vxe-table--render-default.size--mini .vxe-cell--radio .vxe-radio--icon {
    font-size: 14px !important;
}

:v-deep .vxe-table--render-default.size--mini .vxe-cell--checkbox .vxe-checkbox--icon, :v-deep .vxe-table--render-default.size--mini .vxe-cell--radio .vxe-radio--icon {
    font-size: 14px;
}

:v-deep .vxe-table--render-default .vxe-cell--radio .vxe-radio--icon {
    font-size: 16px;
}


.vxe-radio--icon .vxe-radio--unchecked-icon{

}
</style>